<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <title>Change-inside-surroundings.vim by briandoll</title>
    <link rel="stylesheet" href="stylesheets/styles.css">
    <link rel="stylesheet" href="stylesheets/pygment_trac.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script src="javascripts/respond.js"></script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <!--[if lt IE 8]>
    <link rel="stylesheet" href="stylesheets/ie.css">
    <![endif]-->
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

  </head>
  <body>

      <div id="header">
        <nav>
          <li class="fork"><a href="https://github.com/briandoll/change-inside-surroundings.vim">Fork On GitHub</a></li>
          <li class="downloads"><a href="https://github.com/briandoll/change-inside-surroundings.vim/zipball/master">ZIP</a></li>
          <li class="downloads"><a href="https://github.com/briandoll/change-inside-surroundings.vim/tarball/master">TAR</a></li>
          <li class="title">DOWNLOADS</li>
        </nav>
      </div><!-- end header -->

    <div class="wrapper">

      <section>
        <div id="title">
          <h1>Change-inside-surroundings.vim</h1>
          <p>Because memory is a fragile thing</p>
          <hr>
          <span class="credits left">Project maintained by <a href="https://github.com/briandoll">briandoll</a></span>
          <span class="credits right">Hosted on GitHub Pages &mdash; Theme by <a href="http://twitter.com/#!/michigangraham">mattgraham</a></span>
        </div>

        <h1>change-inside-surroundings.vim </h1>

<p>change-inside-surroundings.vim provides two commands:</p>

<ul>
<li>
<code>:ChangeInsideSurrounding</code> (also accessible via <code>&lt;leader&gt;ci</code>) - this will change the contents of the innermost 'surrounding'</li>
<li>
<code>:ChangeAroundSurrounding</code> (also accessible via <code>&lt;leader&gt;cas</code>) - this will change the contents as well as the surrounding characters themselves</li>
</ul><h2>Examples</h2>

<p>Vim already provides fairly easy ways to change the 'surrounding' as long
as you specify the opening 'surrounding' character.  Vim also understands HTML
and XML tags, so you can change inside those as well.  I wanted a <em>single</em>
command that would intelligently just <em>do the right thing</em>.</p>

<p><strong>Normal Vim can do this:</strong></p>

<p>Change inside an HTML tag:</p>

<ul>
<li>Given: <code>&lt;div&gt;London Calling&lt;/div&gt;</code>
</li>
<li>To replace the contents of the div tag I can use: <code>cit</code>
</li>
</ul><p>Change inside curly braces:</p>

<ul>
<li>Given: <code>{ death: "or glory!" }</code>
</li>
<li>To replace the contents of the curly braces I can use: <code>ci{</code>
</li>
</ul><p>Change inside brackets:</p>

<ul>
<li>Given: <code>[ Clampdown those Spanish Bombs ]</code>
</li>
<li>To replace the contents of the square brackets I can use: <code>ci[</code>
</li>
</ul><p>Change inside quotes:</p>

<ul>
<li>Given: <code>"The Guns of Brixton"</code>
</li>
<li>`To replace the contents of the quotes I can use: <code>ci"</code>
</li>
</ul><h2>Change-inside-surroundings.vim makes this simpler</h2>

<p><code>:ChangeInsideSurrounding</code> or <code>&lt;leader&gt;ci</code> will remove the contents of the innermost 'surrounding', leaving you in insert mode.</p>

<p><code>:ChangeAroundSurrounding</code> or <code>&lt;leader&gt;cas</code> will remove the entire text object, including the 'surrounding' characters, leaving you in insert mode.</p>

<p>(Currently supported surroundings are: <code>{}</code>, <code>()</code>, <code>""</code>, <code>&gt;&lt;</code>, <code>[]</code>, <code>''</code>, ``)</p>

<h2>Installation</h2>

<p>If you're using <a href="https://github.com/tpope/vim-pathogen">pathogen.vim</a>, just
copy and paste:</p>

<pre><code>cd ~/.vim/bundle
git clone git://github.com/briandoll/change-inside-surroundings.vim.git
</code></pre>

<h2>License</h2>

<p>Copyright (c) Brian Doll.  Distributed under the same terms as Vim itself.
See <code>:help license</code>.</p>
      </section>

    </div>
    <!--[if !IE]><script>fixScale(document);</script><!--<![endif]-->
    
  </body>
</html>